import qs from 'qs';
// const originalReplace = window.$nuxt.$router.replace;
// const _newReplace = function replace(location) {
//     return originalReplace.call(this, location).catch(error => error);
// }
console.log($nuxt)
const _replace = ({ url, params }) => {
    let o = qs.stringify(params);
    let _path = `${url}?${o}`;
    let originalReplace = this.$router.replace
    originalReplace.call(this,url).catch(error => error)
    // this.$router.replace({
    //     path: _path,
    // })
}

const _push = (url, params) => {
    this.$router.push({
        path: url,
        query: params
    })
}

export const navigator = {
    replace: _replace,
    push: _push
}
